package com.youlu.campus.service.wechat;

import com.youlu.campus.entity.UserOtherInfo;
import com.youlu.campus.entity.UserPO;
import com.youlu.campus.entity.VO.req.CheckMobileVO;
import com.youlu.campus.entity.VO.res.UserResponse;
import com.youlu.campus.entity.WechatMiniUserPO;
import com.youlu.campus.entity.domain.WechatMiniDecryptRequest;

public interface WechatMiniService {
    UserResponse login(String appId, String code);

    WechatMiniUserPO findByOpenId(String appId, String openId);

    /**
     * 解密用户数据
     *
     * @param decryptRequest
     * @return
     */
    WechatMiniUserPO decryptUserData(WechatMiniDecryptRequest decryptRequest, UserPO user);

    /**
     * 绑定手机号
     *
     * @param req
     * @return
     */
    UserResponse bindMobile(CheckMobileVO req);

    String getWebAccessToken(String appId, String openId);

    void setWebAccessToken(String appId, String openId);

    void updateOtherInfo(UserOtherInfo u);

    /**
     * 上传小程序头像
     *
     * @param wechatMiniUserPO
     */
    void uploadMiniWechatPic(WechatMiniUserPO wechatMiniUserPO);

    /**
     * 根据id 更新AccountId
     *
     * @param id
     * @param accountId
     */
    void updateAccountId(String id, String accountId);
}
